
<template>
  <div>
    <el-card style="margin-bottom: 20px">
      导出的文件生成后保留三天，三天后会自动删除。
    </el-card>
    <div class="table-layout">
      <el-card shadow="never">
        <div class="table-handle">
          <el-button type="primary" size="mini" icon="el-icon-refresh" @click="onSearch"></el-button>
        </div>
        <div class="table-box">
          <el-table
              border
              v-loading="loading"
              max-height="420px"
              :data="tableData"
              element-loading-spinner="el-icon-loading"
              element-loading-background="rgba(255, 255, 255, 0.8)"
              @selection-change="onSelect"
          >
            <el-table-column align="center" v-for="item in columns" :key="item.prop" :prop="item.prop" :label="item.label">
              <template slot-scope="scope">
            <span v-if="item.type === 'select'">
              {{ item.mapping[scope.row[item.prop]] }}
            </span>
                <span v-else>{{ scope.row[item.prop] }}</span>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="page-box">
          <el-pagination
              background
              :current-page="pageNo"
              :page-sizes="pageSizes"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="totalSize"
              @size-change="changePageSize"
              @current-change="changePageNo"
          />
        </div>
      </el-card>
    </div>
  </div>
</template>
<script>

import crud from "@/mixins/crud";

export default {
  name: "index",
  mixins: [crud],
  data() {
    return {
      columns: [
        // 文件名、类型、状态
        { label: '文件名', prop: 'fileName' },
        { label: '类型', prop: 'type' },
        { label: '状态', prop: 'status', isTag: true, tagType: 'success', mapping: { 0: '生成中', 1: '生成成功', 2: '生成失败' } },
      ]
    }
  }
}
</script>

<style scoped lang="scss">

</style>
